![]() |
YNQ
YNQ-1.6.0
|
| NQ_STATUS udInit | ( | void | ) |
Initialize UD module.
The project level code must call this function on startup before calling nqStart().
| void udStop | ( | void | ) |
Stop UD module.
The project level must call this function after calling nqStop().
| void udResetServerParams | ( | void | ) |
Reset server parameters
This function reset the value of server parameters that was loaded from server configuration file, it should be called during server restart.
| void udCifsServerStarted | ( | void | ) |
NQ signals to the project level of the server startup complete. Now NQ Server is ready to accept incoming connections.
The default implementation of this function prints a message on console. Integrators may modify it to take measures on the server startup.
| void udCifsServerClosed | ( | void | ) |
NQ signals to the project level of the server shutdown. Now NQ Server does not accept anymore incoming connections.
The default implementation of this function prints a message on console. Integrators may modify it to take measures on the server shutdown.
| void udNetBiosDaemonStarted | ( | void | ) |
NQ signals to the project level of NetBIOS Daemon readiness.
The default implementation of this function is empty. Integrators may modify it to take measures on the daemon startup.
| void udNetBiosDaemonClosed | ( | void | ) |
NQ signals to the project level of NetBIOS Daemon shutdown.
The default implementation of this function is empty. Integrators may modify it to take measures on the daemon shutdown.
| void udGetScopeID | ( | NQ_WCHAR * | buffer | ) |
Obtain the system's Scope ID for NetBIOS. Parameters
| buffer | Buffer for the result of at least 16 bytes. |
| void udGetWins | ( | NQ_WCHAR * | pServers | ) |
Obtain wins addresses information.
This function allows to obtain the default WINS addresses. To add more WINS addresses, use cmNetBiosSetWins() or cmNetBiosSetWinsA().
| pServers | OUT A semicolon-delimited list of WINS servers. |
Get the default domain or workgroup name.
NQ calls this function once on startup. The domain name may be modified later by calling the cmDnsSetDomain() functions.
| buffer | Buffer for the result of at least 16 bytes. |
| isWorkgroup,: | TRUE for a workgroup name, FALSE for a domain name. |
Get DNS initialization parameters (DNS addresses and domain)
This function is called by NQ on startup. It must bring the default list of DNS servers. More DNS servers may be added later by calling the cmDnsSetServers() function.
| domain | The default domain target belongs to. |
| servers | A semicolon-delimited list of DNS servers. |
| NQ_BOOL udGetCredentials | ( | const void * | resource, |
| NQ_WCHAR * | userName, | ||
| NQ_WCHAR * | password, | ||
| NQ_WCHAR * | domain | ||
| ) |
Get authentication parameters for connecting domain controllers.
NQ uses embedded SMB client for domain authentication, joining domain and domain logon. The credentials used during these transactions should be sufficient.
| resource | URI of the destination to connect to. |
| userName | Buffer for user name. This buffer is 256 wide characters at least. |
| password | Buffer for password. This buffer is 256 wide characters at least. |
| domain | Buffer for domain name. This buffer is 256 wide characters at least. |
| NQ_INT udGetPassword | ( | const NQ_WCHAR * | userName, |
| NQ_CHAR * | password, | ||
| NQ_INT * | pwdIsHashed, | ||
| NQ_UINT32 * | userNumber | ||
| ) |
Check password for a specific user.
NQ Server calls this function on SMB logon (session setup) to authenticate a local user. This function is called in the following cases:
Plain text passwords are deprecated.
The default implementation of this function reads passwords froma configuration file.
| userName | User name as a null-terminated string in UTF-16LE. |
| password | Buffer for user's password. This password must be hashed. Plain text passwords are deprecated. |
| pwdIsHashed | Buffer for password has flag as: TRUE when password is hashed, FALSE when password is plain text. Plain text passwords are deprecated. |
| userNumber | Unique user ID (RID). |
This function reads last system error and attempts to convert it into an SMB error.
This function may implement a customized error code conversion. If this conversion fails (a zero value is returned) NQ will use the default conversion. Its default implementation always returns zero.
| sysErr | system error code to convert |
This function converts an internal NQ error into the system error code.
NQ calls this function at the very end of a client transaction processing to map internal error on system error.
| nqErr | NQ internal error code to convert. These error numbers are defined in udapi.h. |
Get transport priority.
NQ Client uses this function to determine in which sequence it attempts to connect to the server. NQ Client can use three transports: NetBIOS over TCP port 139. TCP over IPv4 port 445. TCP over IPv6 port 445. The order in which NQ tries the above transports, depends on the priorities assigned by the function being described. NQ calls this function on each new connection and it does it once for each transport that was included in udparams.h.
| transport | The transport number as:
|
| void udGetServerComment | ( | NQ_WCHAR * | buffer | ) |
Get server comment string.
NQ Server uses this string in several information responses.
| buffer | Buffer for the result of 256 characters at least. |
| void udNetBiosDataIn | ( | void | ) |
Project-level processing on incoming data to NetBios Daemon.
NQ calls this function when NetBIOS daemon receives a message. The default implementation of this function is empty.
| void udServerDataIn | ( | void | ) |
Project-level processing on incoming data to NQ Server.
NQ calls this function when SMB engine receives a message. The default implementation of this function is empty.
| void udServerShareConnect | ( | const NQ_WCHAR * | share | ) |
Project-level processing on client connection to a share.
NQ calls this function when SMB engine receives a tree connect request (Tree Connect). The default implementation of this function is empty.
| share | Name of the share being connected. |
| void udServerShareDisconnect | ( | const NQ_WCHAR * | share | ) |
Project-level processing on client disconnect from a share.
NQ calls this function when SMB engine receives a tree disconnect request (Tree Disconnect). The default implementation of this function is empty.
| share | Name of the share being disconnected. |
| NQ_INT udGetCodePage | ( | void | ) |
Get current code page number.
NQ uses code pages when conversion from UTF-16LE to ANSI characters or vice versa happens. This may happen for host and domain names through NetBIOS and DNS.
| void udSetCodePage | ( | NQ_INT | codePage | ) |
Set current code page number.
NQ uses code pages when conversion from UTF-16LE to ANSI characters or vice versa happens. This may happen for host and domain names through NetBIOS and DNS.
| codePage | Code page number. |
Redefine port number.
NQ uses the following ports:
| port | The default port number in the host byte order. |
| void udGetComputerId | ( | NQ_BYTE * | buf | ) |
Get unique ID for the current machine. The returned 12-byte value should be:
| buf | A 12 - byte buffer to be filled with a unique value. |
| NQ_COUNT udGetUserCount | ( | void | ) |
Get number of local users.
Get local user ID by name.
It is developer's responsibility to implement a particular user management mechanism. Persistent user management may keep a list of users in a file. User RID (relative ID) should be a number unique through over the local user database.
| name | User name as a UTF-16LE string. |
| rid | Buffer for user's unique ID (RID). |
Get local user name by ID.
User RID (relative ID) should be a number unique through over the local user database. User name (i.e., - account name) should be also unique in the local account database. Full user name should not be necessarily unique.
| rid | A unique ID. |
| nameBuffer | Pointer to a buffer of 256 wide characters for user account name (short name). When the given RID corresponds to a local user the function fills this buffer with the account name. |
| fullNameBuffer | Pointer to a buffer of 256 wide characters for a full user name. When the given RID corresponds to a local user the function fills this buffer with a user-friendly name to be displayed on the client. |
| NQ_BOOL udGetUserInfo | ( | NQ_UINT | index, |
| NQ_UINT32 * | rid, | ||
| NQ_WCHAR * | name, | ||
| NQ_WCHAR * | fullName, | ||
| NQ_WCHAR * | description | ||
| ) |
Enumerate local users.
The order of accounts is undefined, but all accounts should have indices from 0 to N where N is the number of users.
| index | Zero-based index of user accounts in the database. |
| rid | Buffer for RID for the index's user. |
| name | Pointer to a buffer of 256 wide characters for user account name (short name). When the given RID corresponds to a local user the function fills this buffer with the account name. |
| fullName | Pointer to a buffer of 256 wide characters for a full user name. When the given RID corresponds to a local user the function fills this buffer with the name to be displayed on the client. |
| description | Pointer to a buffer of 256 wide characters for account description. When the given RID corresponds to a local user the function fills this buffer with account description to be displayed on the client. |
Set user administrative rights.
NQ Server supports two local user groups: Users and Administrators. Any user is a member of the Users group. This function allows to make user a member in the Administrators group or to cancel user's membership in this group.
| rid | A unique account ID. |
| isAdmin | TRUE to set a local user as an administrator, FALSE to remove user from the Administrators group. |
| NQ_BOOL udSetUserInfo | ( | NQ_UINT32 | rid, |
| const NQ_WCHAR * | name, | ||
| const NQ_WCHAR * | fullName, | ||
| const NQ_WCHAR * | descr, | ||
| const NQ_WCHAR * | password | ||
| ) |
Add or modify a local user account.
It is recommended that this function return FALSE when there is another user with the same account name. It is recommended to save password in an encrypted form. Use the following code fragment to encrypt a plain text Unicode password into an MD4 hash:
| rid | A unique account ID. |
| name | New account name of up to 256 wide characters. |
| fullName | New full (user-friendly) user name of up to 256 wide characters. |
| descr | New account description of up to 256 wide characters. |
| password | New password. The password is plain text UTF-16LE. |
| NQ_BOOL udCreateUser | ( | const NQ_WCHAR * | name, |
| const NQ_WCHAR * | fullName, | ||
| const NQ_WCHAR * | description | ||
| ) |
Add a local user.
It is recommended that this function return FALSE when there is another user with the same account name. A new user may be created with an empty or a random password. An expected immediate call to udSetUserInfo() (see above) will set new password.
| name | New account name of up to 256 wide characters. |
| fullName | New full (user-friendly) user name of up to 256 wide characters. |
| description | New account description of up to 256 wide characters. |
Description Remove a local user.
| rid | A unique account ID. |
| NQ_BOOL udSaveShareInformation | ( | const NQ_WCHAR * | name, |
| const NQ_WCHAR * | newName, | ||
| const NQ_WCHAR * | newMap, | ||
| const NQ_WCHAR * | newDescription | ||
| ) |
modify/create share information in a persistent store
| name | share to modify or NULL for a new share |
| newName | new share name |
| newMap | new share path |
| newDescription | new share description |
remove share from the persistent store
| name | share to remove |
Report to the project level about a NetBIOS error. Parameters
| cause | Error code as:
|
| name | The NetBIOS name that caused the error. |
Read computer secret.
Computer secret is a binary array of 16 bytes that NQ receives from Domain Controller after joining a domain. NQ uses this array for subsequent logon into the domain.
| secret | Buffer for a secret pointer. If a value inside that buffer is non-NULL, this function should fill this buffer with a pointer to computer secret. If it is NULL, the function should check for computer secret without setting a pointer to it. |
| NQ_BOOL udGetComputerSecretByDomain | ( | NQ_BYTE * | secret, |
| const NQ_WCHAR * | domainDNS, | ||
| NQ_WCHAR * | domainNB | ||
| ) |
Read computer secret by domain.
Computer secret is a binary array of 16 bytes that NQ receives from Domain Controller after joining a domain. NQ uses this array for subsequent logon into the domain. Parameters
| secret | Buffer for a secret pointer. If a value inside that buffer is non-NULL, this function should fill this buffer with a pointer to computer secret. |
| domainDNS | Domain name DNS |
| domainNB | Domain name NetBIOS. If it is NULL, the function checks for computer secret which refers only to domainDNS. |
| void udSetComputerSecret | ( | NQ_BYTE * | secret | ) |
Save computer secret.
Computer secret is a binary array of 16 bytes that NQ receives from Domain Controller after joining a domain. NQ uses this array for subsequent logon into the domain.
| secret | Computer secret pointer. |
| void udSetComputerSecretByDomain | ( | const NQ_BYTE * | secret, |
| const NQ_WCHAR * | domainDNS, | ||
| const NQ_WCHAR * | domainNB | ||
| ) |
Save computer secret per domain.
Computer secret is a binary array of 16 bytes that NQ receives from Domain Controller after joining a domain. NQ uses this array for subsequent logon into the domain.
| secret | Computer secret pointer. |
| domainDNS | Domain name DNS |
| domainNB | Domain name NetBIOS. If it is NULL, the function saves computer secret which refers only to domainDNS. |
| void udGetFileSystemName | ( | const NQ_WCHAR * | shareName, |
| const NQ_WCHAR * | sharePath, | ||
| NQ_WCHAR * | fileSystemName | ||
| ) |
Determine the file system name for the given share.
This function uses either share name or share path to determine the type of the target file system. Then it copies the name of this file system into the provided buffer. The name should not be longer than 100 characters.
| shareName | Pointer to the share name. |
| sharePath | Pointer to the share path. |
| fileSystemName | Pointer to buffer for the file system name. |
| void udEventLog | ( | NQ_UINT | module, |
| NQ_UINT | eventClass, | ||
| NQ_UINT | type, | ||
| const NQ_WCHAR * | userName, | ||
| const NQ_IPADDRESS * | pIp, | ||
| NQ_UINT32 | status, | ||
| const NQ_BYTE * | parameters | ||
| ) |
Event log function
| module | NQ module that originated this event |
| eventClass | event class |
| type | event type |
| userName | name of the user |
| pIp | next side IP address |
| status | zero if the operation has succeeded or error code on failure for server event this code is the same that will be transmitted to the client for an NQ CIFS client event this value is the same that will be installed as system error |
| parameters | pointer to a structure that is filled with event data actual structure depends on event type |
allocate buffer in the user space
| idx | buffer index zero based |
| numBufs | total number of buffers to be allocated |
| bufferSize | buffer size in bytes |
release buffer in the user space
| idx | buffer index zero based |
| numBufs | total number of buffers to be released |
| buffAddr | buffer address |
| bufferSize | buffer size in bytes |
query user-defined security descriptor
| file | ID of an opened file |
| information | descriptor to get |
| buffer | output buffer |
| NQ_STATUS udSetSecurityDescriptor | ( | NQ_INT | file, |
| NQ_UINT32 | information, | ||
| const void * | buffer, | ||
| NQ_UINT32 | len | ||
| ) |
write user-defined security descriptor
| file | ID of an opened file |
| information | descriptor to set |
| buffer | input buffer |
| len | descriptor length |
| NQ_COUNT udLoadShareSecurityDescriptor | ( | const NQ_WCHAR * | shareName, |
| NQ_BYTE * | buffer, | ||
| NQ_COUNT | bufferLen | ||
| ) |
Get persistent security descriptor for share
| shareName | share name |
| buffer | buffer to read SD in |
| bufferLen | buffer length |
| void udSaveShareSecurityDescriptor | ( | const NQ_WCHAR * | shareName, |
| const NQ_BYTE * | sd, | ||
| NQ_COUNT | sdLen | ||
| ) |
Save persistent security descriptor for share
| shareName | share name |
| sd | pointer to SD |
| sdLen | SD length |
| NQ_BOOL udGetNextShareEx | ( | NQ_WCHAR * | name, |
| NQ_WCHAR * | map, | ||
| NQ_BOOL * | isPrinter, | ||
| NQ_WCHAR * | description, | ||
| NQ_BOOL * | isEncrypted | ||
| ) |
Get next share in the list of shares for CS (extended).
| name | Pointer to the share name buffer. |
| map | Pointer to the share map buffer. |
| isPrinter | 0 for file system, 1 for print queue. |
| description | buffer for the share description |
| isEncrypted | 0 for regular share, 1 for encrypted share (SMB3) |
Get next mount in the list of mounted volumes for Client.
| name | Pointer to the share name buffer. |
| map | Pointer to the share map buffer. |
Get message signing policy CS. Values: 0 - disabled, 1 - enabled, 2 - required.
| policy | Pointer to policy. |
| NQ_BOOL udGetGlobalEncryption | ( | void | ) |
Get server global encryption.
| NQ_BOOL udGetInternalCapture | ( | void | ) |
Determine whether to use internal capture.
Get base folder path of internal capture file
| buffer | buffer for the path |
| size | the size of that buffer |
| NQ_BOOL udGetInternalTrace | ( | void | ) |
Determine whether to use internal trace.
| NQ_INT udGetTaskPriorities | ( | void | ) |
Get task priorities.
| void udGetDriverName | ( | NQ_CHAR * | buffer | ) |
Get CIFS driver name.
| buffer | Buffer for name |
Get host name.
| buffer | Buffer for name |
| length | Length to be returned (not null terminated) |
Get base folder path of log file
| buffer | Buffer for the path |
| size | The size of that buffer |
| void udGetMaxDiskSize | ( | NQ_UINT32 * | size | ) |
Get disk size limit for shares
| size | Pointer to size limit |